/*     */ package com.newcrm.webapi;
/*     */ 
/*     */ import com.newcrm.bean.User;
/*     */ import com.newcrm.exception.NotFoundException;
/*     */ import com.newcrm.util.ParameterUtil;
/*     */ import com.newcrm.util.Util;
/*     */ import com.newcrm.webapi.sub.AddTaskCategory;
/*     */ import com.newcrm.webapi.sub.DeleteTaskCategory;
/*     */ import com.newcrm.webapi.sub.ListTaskCategory;
/*     */ import com.newcrm.webapi.sub.UpdateTaskCategory;
/*     */ import com.newcrm.webapi.sub.UpdateTaskCategorySort;
/*     */ import java.io.IOException;
/*     */ import javax.servlet.RequestDispatcher;
/*     */ import javax.servlet.ServletException;
/*     */ import javax.servlet.http.HttpServletRequest;
/*     */ import javax.servlet.http.HttpServletResponse;
/*     */ import org.apache.log4j.Logger;
/*     */ 
/*     */ public class TaskCategory extends AbstractHttpServlet
/*     */ {
/*     */   private static final long serialVersionUID = 4351754546435203406L;
/*  28 */   private static Logger logger = Logger.getLogger(TaskCategory.class
/*  29 */     .getName());
/*     */ 
/*     */   public void doGet(HttpServletRequest request, HttpServletResponse response)
/*     */     throws ServletException, IOException
/*     */   {
/*  52 */     if (!checkLogin(request)) {
/*  53 */       super.showLoginPage(request, response);
/*  54 */       return;
/*     */     }
/*     */ 
/*  58 */     if (!super.getLoginUser(request).isAdmin) {
/*  59 */       request.getRequestDispatcher("/nopermission.jsp").forward(
/*  60 */         request, response);
/*  61 */       return;
/*     */     }
/*     */ 
/*  64 */     String url = request.getRequestURI();
/*  65 */     String[] param = ParameterUtil.getParameters(url, getTagkey());
/*     */     try {
/*  67 */       if ((param == null) || (param.length == 0)) {
/*  68 */         String operation = Util.getURLParameter(request
/*  69 */           .getParameter("operation"));
/*  70 */         if ((operation == null) || (operation.trim().length() == 0)) {
/*  71 */           new ListTaskCategory(this).parse(request, response);
/*  72 */           return;
/*     */         }
/*     */ 
/*  75 */         if ("sort".equals(operation)) {
/*  76 */           new UpdateTaskCategorySort(this).parse(request, response);
/*  77 */           return;
/*     */         }
/*     */       }
/*     */     } catch (NotFoundException e) {
/*  81 */       logger.warn(e);
/*  82 */       request.getRequestDispatcher("/errorpage.jsp").forward(request, 
/*  83 */         response);
/*  84 */       return;
/*     */     }
/*     */ 
/*  87 */     super.doGet(request, response);
/*     */   }
/*     */ 
/*     */   protected AbstractAction getAddAction()
/*     */   {
/*  92 */     return new AddTaskCategory(this);
/*     */   }
/*     */ 
/*     */   protected AbstractAction getDeleteAction(String id)
/*     */   {
/*  97 */     return new DeleteTaskCategory(this, id);
/*     */   }
/*     */ 
/*     */   protected AbstractAction getListAction()
/*     */   {
/* 103 */     return null;
/*     */   }
/*     */ 
/*     */   protected AbstractAction getShowAction(String id)
/*     */   {
/* 109 */     return null;
/*     */   }
/*     */ 
/*     */   protected AbstractAction getShowAddPageAction()
/*     */   {
/* 115 */     return null;
/*     */   }
/*     */ 
/*     */   protected AbstractAction getShowConfirmDestroyAction(String id)
/*     */   {
/* 121 */     return null;
/*     */   }
/*     */ 
/*     */   protected AbstractAction getShowUpdatePageAction(String id)
/*     */   {
/* 127 */     return null;
/*     */   }
/*     */ 
/*     */   protected String getTagkey()
/*     */   {
/* 132 */     return "/taskcategory";
/*     */   }
/*     */ 
/*     */   protected AbstractAction getUpdateAction(String id)
/*     */   {
/* 137 */     return new UpdateTaskCategory(this, id);
/*     */   }
/*     */ }

/* Location:           C:\E\referenceProject\CRM参考\qikebao\WEB-INF\lib\qikebao.jar
 * Qualified Name:     com.newcrm.webapi.TaskCategory
 * JD-Core Version:    0.6.1
 */